﻿using System;
using Core;
using Core.Mgr;
using Core.Mgrs;
using Global.Mgr;
using Global.Module;
using UnityEngine;

namespace Global
{
    public class Main : MonoBehaviour
    {
        private void Awake()
        {
            KKGL.MainBehaviour = this;
            ModuleMgr.Ins.OnInit();
            DontDestroyOnLoad(this);
        }

        private void Start()
        {
            KKGL.SysEvent.Notify(ELifeCycle.OnStart);
        }

        private void Update()
        {
            KKGL.SysEvent.Notify(ELifeCycle.OnUpdate, ValueTuple.Create(Time.deltaTime));
        }

        private void FixedUpdate()
        {
            KKGL.SysEvent.Notify(ELifeCycle.OnFixedUpdate, ValueTuple.Create(Time.fixedDeltaTime));
        }
    }
}